package org.lalib.controller.form;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.SessionScoped;

import org.lalib.acquire.IControllerForm;
import org.lalib.entity.object.EFood;
import org.lalib.entity.object.EUser;
import org.springframework.stereotype.Controller;

@SessionScoped
@Controller("cUserFoodMatchForm")
public class CUserFoodMatchForm implements IControllerForm {

	private static final long serialVersionUID = 1L;

	private EUser user;
	private List<EFood> allFoods = new ArrayList<>();
	private List<FoodMatchBean> includedFoods = new ArrayList<>();
	private List<FoodMatchBean> excludedFoods = new ArrayList<>();

	public EUser getUser() {
		return user;
	}

	public void setUser(EUser user) {
		this.user = user;
	}

	public List<EFood> getAllFoods() {
		return allFoods;
	}

	public void setAllFoods(List<EFood> allFoods) {
		this.allFoods = allFoods;
	}

	public List<FoodMatchBean> getIncludedFoods() {
		return includedFoods;
	}

	public void setIncludedFoods(List<FoodMatchBean> includedFoods) {
		this.includedFoods = includedFoods;
	}

	public List<FoodMatchBean> getExcludedFoods() {
		return excludedFoods;
	}

	public void setExcludedFoods(List<FoodMatchBean> excludedFoods) {
		this.excludedFoods = excludedFoods;
	}

	public class FoodMatchBean {

		public FoodMatchBean() {
		}

		public FoodMatchBean(EFood food) {
			seteFood(food);
		}

		private EFood eFood;
		private boolean selected;

		public EFood geteFood() {
			return eFood;
		}

		public void seteFood(EFood eFood) {
			this.eFood = eFood;
		}

		public boolean isSelected() {
			return selected;
		}

		public void setSelected(boolean selected) {
			this.selected = selected;
		}

	}
}
